using System.IO;

namespace SvnCrowdConverter
{
    internal class WorkingDirIoAdapter : IIoAdapter
    {
        private readonly IIoAdapter ioAdapter = new IoAdapter();
        private readonly string root;

        public WorkingDirIoAdapter(string root)
        {
            this.root = root;
        }

        public bool Exists(string file)
        {
            return ioAdapter.Exists(file);
        }

        public string ReadAllText(string file)
        {
            var filePath = new FileInfo(file);

            return File.ReadAllText(Path.Combine(root, filePath.Name));
        }
    }
}